package com.primus.server.entity.store;

import com.google.common.collect.Lists;
import com.primus.server.entity.BaseEntity;
import com.primus.server.entity.user.Reply;
import com.primus.server.entity.user.User;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Entity
@Getter
@Setter
public class Comment extends BaseEntity {

    private String content;

    private Date createdDate;

    private Double score;

    @OneToOne
    private User owner;

    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
    private List<Reply> replies = Lists.newArrayList();;
}
